import * as types from './actions-type'

export default {
    // 对 每个store 书写方法 默认值
    shouldLoad(state = false, action) {
        const { type, payload } = action
        switch (type) {
            case types.SET_SHOULD_LOAD:
                return payload
            default:
        }

        return state
    },
    oneLevelPartitions(state = '', action) {
        const { type, payload } = action
        switch (type) {
            case types.SET_ONE_LEVEL_PARTITIONS:
                return payload
            default:
        }

        return state
    },

    banners(state = '', action) {
        const { type, payload } = action
        switch (type) {
            case types.SET_BANNERS:
                return payload
            default:
        }

        return state
    },
    partitions(state = '', action) {
        const { type, payload } = action
        switch (type) {
            case types.SET_PARTITIONS:
                return payload
            default:
        }

        return state
    },
    rankingVideos(state = '', action) {
        const { type, payload } = action
        switch (type) {
            case types.SET_RANKING_VIDEOS:
                return payload
            default:
        }

        return state
    },

    rankingPartitions(state = '', action) {
        const { type, payload } = action
        switch (type) {
            case types.SET_RANKING_PARTITIONS:
                return payload
            default:
        }

        return state
    },
    tabindex(state = 0, action) {
        const { type, payload } = action
        switch (type) {
            case types.SET_TABINDEX:
                return payload
            default:
        }
        return state
    },
    isdraw(state = false, action) {
        const { type, payload } = action
        switch (type) {
            case types.SET_ISDRAW:
                return payload
            default:
        }

        return state
    },
    additionalVideos(state = [], action) {
        const { type, payload } = action
        switch (type) {
            case types.SET_ADDITIONAL_VIDEOS:
                return payload
            default:
        }

        return state
    },
    liveData(state = {}, action) {
        const { type, payload } = action
        switch (type) {
            case types.SET_LIVE_DATA:
                return payload
            default:
        }
        return state
    },
    liveListData(state = {}, action) {
        const { type, payload } = action
        switch (type) {
            case types.SET_LIVE_LIST:
                return payload
            default:
        }
        return state
    },
    roomData(state = {}, action) {
        const { type, payload } = action
        switch (type) {
            case types.SET_ROOM_DATA:
                return payload
            default:
        }
        return state
    },
    upUser(state = {}, action) {
        const { type, payload } = action
        switch (type) {
            case types.SET_UP_USER:
                return payload
            default:
        }
        return state
    },
    video(state = {}, action) {
        const { type, payload } = action
        switch (type) {
            case types.SET_VIDEO_INFO:
                return payload
            default:
        }
        return state
    }
}
